package com.justgame.project.cloud.common.util;

import java.util.Random;
import java.util.UUID;

/**
 * ID工具
 *
 * @author ZhouWeiBo
 */
public class IdUtils {

    public static String create() {
        return create(12);
    }

    public static String create(int num) {
        return UUID.randomUUID().toString().replaceAll("-", "").substring(0, num);
    }

    public static String original() {
        return UUID.randomUUID().toString();
    }

    public static Long uniqueId() {
        return System.currentTimeMillis() + new Random().nextInt(9999999);
    }
}
